class StudentIterator:
    def __init__(self, data):
        self.data = data
        self.index = -1

    def __next__(self):
        if self.index >= len(self.data) - 1:
            raise StopIteration
        self.index += 1
        return self.data[self.index]


class StudentController:
    def __init__(self):
        self.list_student = []

    def __iter__(self):
        return StudentIterator(self.list_student)


controller = StudentController()
controller.list_student.append("lkp")
controller.list_student.append("lkpkp")
controller.list_student.append("lkpkpkp")

for item in controller:
    print(item, end=" ")
